package com.mjkj.controller;

import com.mjkj.core.result.Result;
import com.mjkj.core.result.ResultGenerator;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@Tag(name = "订单管理", description = "订单管理")
@Slf4j
public class OrderController {

    @Resource
    private RestTemplate restTemplate;

    public static final String url = "http://cloud-payment-service";

    @GetMapping("/t-order/list")
    @Operation(summary = "支付交易表列表")
    public Result list(){
        Result result = restTemplate.getForObject(url + "/t-pay/list", Result.class);
        return ResultGenerator.genSuccessResult(result);
    }
}
